#!/bin/bash

#Inspect CPU

#Sun Jul 31 17:25:41 CST 2016

PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/wl/bin
export PATH

TERM=linux
export TERM

CpuResult=$(top -bn 1 | grep "Cpu" | awk '{print $5}' | sed 's/\..*$//g')

# if [[ $CpuResult < 20 ]];then
  echo "CPU WARNING : $CpuResult"  #  > /service/script/.cpu_in.txt
  top -bn 1  # >> /service/script./cpu_in.txt
#   mail -s "Inspcet CPU" wl < /service/script/.cpu_in.txt
# fi